<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
  <body class="nav-md">
  	<div class="">
        <div class="page-title">
          <div class="title_left">
            <h3>专栏管理</h3>
          </div>
          <div class="title_right">
          	<div class="pull-right">
                <a onclick="goSubject()" class="btn btn-app">
                    <i class="fa fa-refresh"></i>刷新
                </a>
          		<a onclick="goAddSubject()" class="btn btn-app">
          			<i class="fa fa-file"></i>新增
          		</a>
          	</div>
          </div>
        </div>
        
        <div class="clearfix"></div>
        
    	<div class="row">
    		<div class="col-md-12 col-sm-12 col-xs-12">
            <div class="x_panel">
              <div class="x_title">
              	<h2>专栏列表</h2>
			  	<div class="clearfix"></div>
              </div>
              
              <div class="x_content">
                <table id="datatable" class="table table-striped table-bordered">
                  <thead>
                    <tr>
                      <th>专栏名称</th>
                      <th>主讲人</th>
                      <th>讲师账号</th>
                      <th>创建日期</th>
                      <th>发布状态</th>
                      <th>发布日期</th>
                      <th>订阅价格</th>
                      <th>专栏操作</th>
                      <!-- <th>课程排序</th> -->
                    </tr>
                  </thead>
                  <tbody>
                    <tr th:each="subject : ${subjectList}">
                      <td th:text="${subject.subjectName}">Tiger Nixon</td>
                      <td th:text="${subject.realName}">System Architect</td>
                      <td th:text="${subject.userName}">System Architect</td>
                      <td th:text="${subject.createdDateStr}">Edinburgh</td>
                      <td th:text="${subject.statesStr}">61</td>
                      <td th:text="${subject.publishDateStr}">2011/04/25</td>
                      <td th:text="${subject.actualPrice}">61</td>
                      <td>
                        <!-- 待提交 -->
                        <a th:if="${subject.states} == '0'" class="btn btn-primary  btn-xs" th:onclick="'javascript:inspectSubject(\''+ ${subject.id}+'\')'"><i class="fa fa-search"></i> 查看</a>
                        <a th:if="${subject.states} == '0'" class="btn btn-info  btn-xs" th:onclick="'javascript:editSubject(\''+ ${subject.id}+'\')'"><i class="fa fa-pencil"></i> 编辑</a>
                        <a th:if="${subject.states} == '0'" class="btn btn-warning  btn-xs" th:onclick="'javascript:submitSubject(\''+ ${subject.id}+'\')'"><i class="fa fa-check"></i> 提交</a>
                      	<a th:if="${subject.states} == '0' and ${roleType} == '0'" class="btn btn-danger btn-xs" th:onclick="'javascript:clearSubject(\''+ ${subject.id}+'\')'"><i class="fa fa-trash-o"></i> 删除</a>
                      	
                      	<!-- 待审核 -->
                      	<a th:if="${subject.states} == '2'" class="btn btn-primary  btn-xs" th:onclick="'javascript:inspectSubject(\''+ ${subject.id}+'\')'"><i class="fa fa-search"></i> 查看</a>
                      	<a th:if="${subject.states} == '2' and ${roleType} == '0'" class="btn btn-success  btn-xs" th:onclick="'javascript:publishSubject(\''+ ${subject.id}+'\')'"><i class="fa fa-toggle-on"></i> 发布</a>
                      	<a th:if="${subject.states} == '2' and ${roleType} == '0'" class="btn btn-warning  btn-xs" th:onclick="'javascript:rollbackSubject(\''+ ${subject.id}+'\')'"><i class="fa fa-times"></i> 退回</a>
                      	<a th:if="${subject.states} == '2' and ${roleType} == '0'" class="btn btn-danger  btn-xs" th:onclick="'javascript:clearSubject(\''+ ${subject.id}+'\')'"><i class="fa fa-trash-o"></i> 删除</a>
                      	<a th:if="${subject.states} == '2' and ${roleType} == '1'" class="btn btn-warning  btn-xs" th:onclick="'javascript:rollbackSubject(\''+ ${subject.id}+'\')'"><i class="fa fa-minus-circle"></i> 撤回</a>
                      	
                      	<!-- 已发布 -->
                      	<a th:if="${subject.states} == '1'" class="btn btn-primary  btn-xs" th:onclick="'javascript:inspectSubject(\''+ ${subject.id}+'\')'"><i class="fa fa-search"></i> 查看</a>
                      	<a th:if="${subject.states} == '1'" class="btn btn-warning  btn-xs" th:onclick="'javascript:rollbackSubject(\''+ ${subject.id}+'\')'"><i class="fa fa-minus-circle"></i> 下架</a>
                      	<a th:if="${subject.states} == '1' and ${roleType} == '0'" class="btn btn-danger  btn-xs" th:onclick="'javascript:clearSubject(\''+ ${subject.id}+'\')'"><i class="fa fa-trash-o"></i> 删除</a>
                      	
                      	<!-- 已删除 -->
                      	<a th:if="${subject.states} == '3' and ${roleType} == '0'" class="btn btn-success  btn-xs" th:onclick="'javascript:rollbackSubject(\''+ ${subject.id}+'\')'"><i class="fa fa-mail-reply"></i> 恢复</a>
                      </td>
                      <!-- <td>
                      
                      </td> -->
                    </tr>
                  </tbody>
                </table>
              </div>
            </div>
            </div>
        </div>
    </div>
    <!-- Custom Theme Scripts -->
	<script src="../cms/js/subject.js"></script>
  </body>
</html>